/**
 * 
 */
package com.oscarmovie.action;

import com.opensymphony.xwork2.ActionSupport;
import com.oscarmovie.Constants;
import com.oscarmovie.model.Movie;
import com.oscarmovie.model.Person;
import com.oscarmovie.service.MovieService;
import com.oscarmovie.service.PersonService;

/**
 * @author David
 *
 */
@SuppressWarnings("serial")
public class ToolTipAction extends ActionSupport {
	
	private MovieService movieService;
	private PersonService personService;	
	
	private int movieId;
	private int personId;
	
	private Person person;
	private Movie movie;
	
	public String getPersonTip() throws Exception{
		person = personService.load(personId);
		
		return Constants.PERSON;
	}
	
	public String getMovieTip() throws Exception{
		movie = movieService.load(movieId);
		
		return Constants.MOVIE;
	}


	/**
	 * @param movieService the movieService to set
	 */
	public void setMovieService(MovieService movieService) {
		this.movieService = movieService;
	}


	/**
	 * @param personService the personService to set
	 */
	public void setPersonService(PersonService personService) {
		this.personService = personService;
	}

	/**
	 * @param movieId the movieId to set
	 */
	public void setMovieId(int movieId) {
		this.movieId = movieId;
	}

	/**
	 * @param personId the personId to set
	 */
	public void setPersonId(int personId) {
		this.personId = personId;
	}

	/**
	 * @return the person
	 */
	public Person getPerson() {
		return person;
	}

	/**
	 * @return the movie
	 */
	public Movie getMovie() {
		return movie;
	}
	

}
